package com.ts.utils

import android.opengl.GLES20.GL_INVALID_ENUM
import android.opengl.GLES20.GL_INVALID_FRAMEBUFFER_OPERATION
import android.opengl.GLES20.GL_INVALID_OPERATION
import android.opengl.GLES20.GL_INVALID_VALUE
import android.opengl.GLES20.GL_NO_ERROR
import android.opengl.GLES20.glGetError
import android.util.Log
import javax.microedition.khronos.opengles.GL10.GL_OUT_OF_MEMORY
import javax.microedition.khronos.opengles.GL10.GL_STACK_OVERFLOW
import javax.microedition.khronos.opengles.GL10.GL_STACK_UNDERFLOW

class OpenglGetError {


    companion object{
    fun getError(): String {
        var errorCode = 0;
        var error = ""

//        while (glGetError() != GL_NO_ERROR) {
//            when (glGetError()) {
//                GL_INVALID_ENUM -> error = "INVALID_ENUM";
//                GL_INVALID_VALUE -> error = "INVALID_VALUE";
//                GL_INVALID_OPERATION -> error = "INVALID_OPERATION";
//                GL_STACK_OVERFLOW -> error = "STACK_OVERFLOW";
//                GL_STACK_UNDERFLOW -> error = "STACK_UNDERFLOW";
//                GL_OUT_OF_MEMORY -> error = "OUT_OF_MEMORY";
//                GL_INVALID_FRAMEBUFFER_OPERATION -> error = "INVALID_FRAMEBUFFER_OPERATION";
//            }
//
//        }

        return glGetError().toString()+"erore";
    }
    }
}